table_wight = 7

x_list = [0, 1, 0, 1]
y_list = [0, 0, 1, 1]

def printx(x):
    return str(x)

def printy(y):
    return str(y)

def xandy(x, y):
    return str(x and y)

def xory(x, y):
    return str(x or y)

def xxory(x, y):
    if x != y:
        return 1
    else:
        return 0
    
def ximply(x, y):
    if x == 1 and y == 0:
        return str(y)
    else:
        return str(1)

def xecvy(x, y):
    if x == y:
        return 1
    else: 
        return 0
    
def border(wight):
    border = '='
    for i in range(wight):
        border +=  '==='
    print(border)

def line(x, y):
    print('|', printx(x), printy(y), '|', xandy(x, y), xory(x, y) + ' ',
        xxory(x, y), '', ximply(x, y), '', xecvy(x, y), '|')


def table(wight):

    border(wight)

    print('|', 'x y | * + xor -> =', '|')

    border(wight)

    for i in range(len(x_list)):
        line(x_list[i], y_list[i])

    border(wight)

table(table_wight)
